home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / apps / 526 / auto / poolfix3.doc < prev    next >
Text File  |  1991-08-24  |  3KB  |  66 lines

  1. Atari Corp., January 19, 1990
  2.  
  3. There is a rare bug in Rainbow TOS (1.4) and STe TOS (1.6) involving
  4. the way GEMDOS handles its internal memory.  You probably have never
  5. seen this bug, and if you use this patch program, you never will.
  6.  
  7. Place POOLFIX3.PRG in your AUTO folder and reboot your machine.  That's
  8. all there is to it.  POOLFIX3.PRG will run every time you boot your
  9. machine, so the bug will never ever bite you.
  10.  
  11. You might get a message to the effect that it must run first in the
  12. AUTO folder.  If this happens, copy the programs from your AUTO folder
  13. to another place and erase them all from the AUTO folder.  Now copy
  14. POOLFIX3.PRG into your AUTO folder, and then all the other programs
  15. which were there.
  16.  
  17. (A version of this patch was released January 10; it didn't work, and
  18. shouldn't be used.  Another was released January 18; it didn't work
  19. either. (Look, I'm only human!)  This is Take 3.)
  20.  
  21. **********************************************************************
  22.  
  23. If you are interested in the technical details of why this program
  24. is necessary and what it does, read on:
  25.  
  26. The bug doesn't bite very often.  You probably haven't ever seen it. 
  27. It happens when programs use Malloc a lot and you have a lot of folders
  28. in your system.  (Yes, this bug was introduced as part of the code
  29. which got rid of the 40-folder limit.)
  30.  
  31. The OS pool is the internal memory used by GEMDOS to keep track of
  32. directories, files, handles, and internal memory.  Sometimes, GEMDOS
  33. uses only part of a block.  When there are two blocks that are only
  34. partly used, and the used parts would fit into one block, the space
  35. can be compacted to create one completely used block and one free
  36. block.
  37.  
  38. Unfortunately, there's a bug in the compaction routine.  This patch
  39. prevents that compaction routine from being executed, by doing the
  40. compaction (with a bug-free routine) before GEMDOS has a chance to.
  41.  
  42. This code runs before every GEMDOS call.  It uses a flag to tell
  43. whether it needs to run the compaction routine before it lets GEMDOS
  44. handle the call.  If the call is one of the Pterm calls, or an Mfree()
  45. call, it sets the flag so the compaction will run before the NEXT
  46. Gemdos call:
  47.  
  48.     new gemdos entry point:
  49.  
  50.         if (flag is set)
  51.             run compact;
  52.  
  53.         if (call is Mfree or one of the Pterm calls)
  54.             set the flag;
  55.         else
  56.             clear the flag;
  57.  
  58.         jump to the original gemdos entry point;
  59.  
  60.  
  61. The compaction routine runs through GEMDOS's internal memory using
  62. unpublished variables (don't you dare use them yourself!) and compacts
  63. empty space out of the memory blocks, so the routine inside GEMDOS
  64. never finds any space to compact, and the incorrect code never runs.
  65.  
  66.